#ifndef __MODULES_LOGIN_LOGIN_MODULE_H__
#define __MODULES_LOGIN_LOGIN_MODULE_H__

#include <boost/asio.hpp>

#include <common/base/module.h>

class Player;

class LoginModule : public IModule
{
public:
    virtual bool doDispatch(const std::shared_ptr<SubServerMgr>& submgr,
                            const std::shared_ptr<Player>& player,
                            const MessageID& msgID,
                            const char* buf,
                            std::size_t bufSize);

private:
    bool onChoosePlayerReq(const std::shared_ptr<SubServerMgr>& submgr,
                           const std::shared_ptr<Player>& player,
                           const MessageID& msgID,
                           const char* buf,
                           std::size_t bufSize);

    bool onClientCloseReq(const std::shared_ptr<SubServerMgr>& submgr,
                          const std::shared_ptr<Player>& player,
                          const MessageID& msgID,
                          const char* buf,
                          std::size_t bufSize);
                          
    bool onTestReq(const std::shared_ptr<SubServerMgr>& submgr,
                   const std::shared_ptr<Player>& player,
                   const MessageID& msgID,
                   const char* buf,
                   std::size_t bufSize);

};

#endif // __MODULES_LOGIN_LOGIN_MODULE_H__
